import React from 'react';

require("./index.less")

interface IProps {
  visible: boolean
  title?: any
  onCancel: () => void
  onOk: () => void
}


const ModalBox: React.FC<IProps> = (props) => {

  const {children, visible, title, onCancel, onOk} = props
  if (!visible) {
    return null
  }
  return (
    <div className='modalBox'>
      <div className="header">
        <div className='title'>{title}</div>
        <div className='btns'>
          <div className='cancel' onClick={onCancel}>取消</div>
          <div className='sure' onClick={onOk}>确定</div>
        </div>
      </div>
      <div className='content'>
        {children}
      </div>
    </div>
  );
};
export default ModalBox
